package com.teamcenter.rac.massupdate.validators;

import org.apache.log4j.Logger;
import org.eclipse.core.databinding.validation.IValidator;

import com.teamcenter.rac.kernel.TCSession;
import com.teamcenter.rac.massupdate.Activator;

public abstract class AbstractMassUpdateValidator
  implements IValidator
{
  private TCSession m_tcSession;
  
  protected TCSession getTCSession()
  {
    try
    {
      if (this.m_tcSession == null) {
        this.m_tcSession = ((TCSession)Activator.getDefault().getSessionService().getSession(TCSession.class.getName()));
      }
    }
    catch (Exception localException)
    {
      Logger.getLogger(AbstractMassUpdateValidator.class).error(localException.getLocalizedMessage(), localException);
    }
    return this.m_tcSession;
  }
}
